package com.zhonghui.modlules.product.eshopDomain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eshop.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.zhonghui.common.eshopDto.FromatDetailDto;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

@TableName("store_seckill")
public class StoreSeckill extends BaseDomain {
    @TableId
    @ApiModelProperty("商品秒杀产品表id")
    private Long id;
    @ApiModelProperty("商品id")
    private Long productId;
    @NotBlank(
            message = "请上传商品图片"
    )
    @ApiModelProperty("推荐图")
    private String image;
    @NotBlank(
            message = "请上传商品轮播"
    )
    @ApiModelProperty("轮播图")
    private String images;
    @NotBlank(
            message = "请填写秒杀名称"
    )
    @ApiModelProperty("秒杀名称")
    private String title;
    @ApiModelProperty("简介")
    private String info;
    @ApiModelProperty("返多少积分")
    private BigDecimal giveIntegral;
    @ApiModelProperty("排序")
    private Integer sort;
    @ApiModelProperty("秒杀库存")
    private Integer stock;
    @ApiModelProperty("秒杀价")
    private BigDecimal price;
    @ApiModelProperty("原价")
    private BigDecimal otPrice;
    @ApiModelProperty("成本")
    private BigDecimal cost;
    @ApiModelProperty("秒杀销量")
    private Integer sales;
    @ApiModelProperty("单位名")
    private String unitName;
    @ApiModelProperty("邮费")
    private BigDecimal postage;
    @NotBlank(
            message = "请填写详情"
    )
    @ApiModelProperty("详细内容")
    private String description;
    @NotNull(
            message = "请选择秒杀开始时间"
    )
    @ApiModelProperty("秒杀开始时间")
    private Date startTime;
    @NotNull(
            message = "请选择秒杀结束时间"
    )
    @ApiModelProperty("秒杀结束时间")
    private Date stopTime;
    @ApiModelProperty("产品状态")
    private Integer status;
    @ApiModelProperty("是否包邮")
    private Integer isPostage;
    @ApiModelProperty("是否热门推荐")
    private Integer isHot;
    @NotNull(
            message = "请输入限购"
    )
    @Min(
            message = "限购不能小于0",
            value = 1L
    )
    @ApiModelProperty("最多秒杀几个商品")
    private Integer num;
    @ApiModelProperty("是否显示 0否 1显示")
    private Integer isShow;
    @NotNull(
            message = "请选择开始时间"
    )
    @ApiModelProperty("时间段id")
    private Integer timeId;
    @ApiModelProperty("规格 0单规格 1多规格")
    private Integer specType;
    @JsonProperty("temp_id")
    @ApiModelProperty("运费模板ID")
    private Long tempId;
    @TableField(
            exist = false
    )
    @ApiModelProperty("属性项目")
    private List<FromatDetailDto> items;
    @TableField(
            exist = false
    )
    @ApiModelProperty("sku结果集")
    private List<Map<String, Object>> attrs;

    public void copy(StoreSeckill source) {
        BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
    }

    public StoreSeckill() {
    }

    public Long getId() {
        return this.id;
    }

    public Long getProductId() {
        return this.productId;
    }

    public String getImage() {
        return this.image;
    }

    public String getImages() {
        return this.images;
    }

    public String getTitle() {
        return this.title;
    }

    public String getInfo() {
        return this.info;
    }

    public BigDecimal getGiveIntegral() {
        return this.giveIntegral;
    }

    public Integer getSort() {
        return this.sort;
    }

    public Integer getStock() {
        return this.stock;
    }

    public BigDecimal getPrice() {
        return this.price;
    }

    public BigDecimal getOtPrice() {
        return this.otPrice;
    }

    public BigDecimal getCost() {
        return this.cost;
    }

    public Integer getSales() {
        return this.sales;
    }

    public String getUnitName() {
        return this.unitName;
    }

    public BigDecimal getPostage() {
        return this.postage;
    }

    public String getDescription() {
        return this.description;
    }

    public Date getStartTime() {
        return this.startTime;
    }

    public Date getStopTime() {
        return this.stopTime;
    }

    public Integer getStatus() {
        return this.status;
    }

    public Integer getIsPostage() {
        return this.isPostage;
    }

    public Integer getIsHot() {
        return this.isHot;
    }

    public Integer getNum() {
        return this.num;
    }

    public Integer getIsShow() {
        return this.isShow;
    }

    public Integer getTimeId() {
        return this.timeId;
    }

    public Integer getSpecType() {
        return this.specType;
    }

    public Long getTempId() {
        return this.tempId;
    }

    public List<FromatDetailDto> getItems() {
        return this.items;
    }

    public List<Map<String, Object>> getAttrs() {
        return this.attrs;
    }

    public void setId(final Long id) {
        this.id = id;
    }

    public void setProductId(final Long productId) {
        this.productId = productId;
    }

    public void setImage(final String image) {
        this.image = image;
    }

    public void setImages(final String images) {
        this.images = images;
    }

    public void setTitle(final String title) {
        this.title = title;
    }

    public void setInfo(final String info) {
        this.info = info;
    }

    public void setGiveIntegral(final BigDecimal giveIntegral) {
        this.giveIntegral = giveIntegral;
    }

    public void setSort(final Integer sort) {
        this.sort = sort;
    }

    public void setStock(final Integer stock) {
        this.stock = stock;
    }

    public void setPrice(final BigDecimal price) {
        this.price = price;
    }

    public void setOtPrice(final BigDecimal otPrice) {
        this.otPrice = otPrice;
    }

    public void setCost(final BigDecimal cost) {
        this.cost = cost;
    }

    public void setSales(final Integer sales) {
        this.sales = sales;
    }

    public void setUnitName(final String unitName) {
        this.unitName = unitName;
    }

    public void setPostage(final BigDecimal postage) {
        this.postage = postage;
    }

    public void setDescription(final String description) {
        this.description = description;
    }

    public void setStartTime(final Date startTime) {
        this.startTime = startTime;
    }

    public void setStopTime(final Date stopTime) {
        this.stopTime = stopTime;
    }

    public void setStatus(final Integer status) {
        this.status = status;
    }

    public void setIsPostage(final Integer isPostage) {
        this.isPostage = isPostage;
    }

    public void setIsHot(final Integer isHot) {
        this.isHot = isHot;
    }

    public void setNum(final Integer num) {
        this.num = num;
    }

    public void setIsShow(final Integer isShow) {
        this.isShow = isShow;
    }

    public void setTimeId(final Integer timeId) {
        this.timeId = timeId;
    }

    public void setSpecType(final Integer specType) {
        this.specType = specType;
    }

    @JsonProperty("temp_id")
    public void setTempId(final Long tempId) {
        this.tempId = tempId;
    }

    public void setItems(final List<FromatDetailDto> items) {
        this.items = items;
    }

    public void setAttrs(final List<Map<String, Object>> attrs) {
        this.attrs = attrs;
    }

    public String toString() {
        return "StoreSeckill(id=" + this.getId() + ", productId=" + this.getProductId() + ", image=" + this.getImage() + ", images=" + this.getImages() + ", title=" + this.getTitle() + ", info=" + this.getInfo() + ", giveIntegral=" + this.getGiveIntegral() + ", sort=" + this.getSort() + ", stock=" + this.getStock() + ", price=" + this.getPrice() + ", otPrice=" + this.getOtPrice() + ", cost=" + this.getCost() + ", sales=" + this.getSales() + ", unitName=" + this.getUnitName() + ", postage=" + this.getPostage() + ", description=" + this.getDescription() + ", startTime=" + this.getStartTime() + ", stopTime=" + this.getStopTime() + ", status=" + this.getStatus() + ", isPostage=" + this.getIsPostage() + ", isHot=" + this.getIsHot() + ", num=" + this.getNum() + ", isShow=" + this.getIsShow() + ", timeId=" + this.getTimeId() + ", specType=" + this.getSpecType() + ", tempId=" + this.getTempId() + ", items=" + this.getItems() + ", attrs=" + this.getAttrs() + ")";
    }

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof StoreSeckill)) {
            return false;
        } else {
            StoreSeckill other = (StoreSeckill)o;
            if (!other.canEqual(this)) {
                return false;
            } else if (!super.equals(o)) {
                return false;
            } else {
                label349: {
                    Object this$id = this.getId();
                    Object other$id = other.getId();
                    if (this$id == null) {
                        if (other$id == null) {
                            break label349;
                        }
                    } else if (this$id.equals(other$id)) {
                        break label349;
                    }

                    return false;
                }

                label342: {
                    Object this$productId = this.getProductId();
                    Object other$productId = other.getProductId();
                    if (this$productId == null) {
                        if (other$productId == null) {
                            break label342;
                        }
                    } else if (this$productId.equals(other$productId)) {
                        break label342;
                    }

                    return false;
                }

                Object this$sort = this.getSort();
                Object other$sort = other.getSort();
                if (this$sort == null) {
                    if (other$sort != null) {
                        return false;
                    }
                } else if (!this$sort.equals(other$sort)) {
                    return false;
                }

                label328: {
                    Object this$stock = this.getStock();
                    Object other$stock = other.getStock();
                    if (this$stock == null) {
                        if (other$stock == null) {
                            break label328;
                        }
                    } else if (this$stock.equals(other$stock)) {
                        break label328;
                    }

                    return false;
                }

                Object this$sales = this.getSales();
                Object other$sales = other.getSales();
                if (this$sales == null) {
                    if (other$sales != null) {
                        return false;
                    }
                } else if (!this$sales.equals(other$sales)) {
                    return false;
                }

                label314: {
                    Object this$status = this.getStatus();
                    Object other$status = other.getStatus();
                    if (this$status == null) {
                        if (other$status == null) {
                            break label314;
                        }
                    } else if (this$status.equals(other$status)) {
                        break label314;
                    }

                    return false;
                }

                Object this$isPostage = this.getIsPostage();
                Object other$isPostage = other.getIsPostage();
                if (this$isPostage == null) {
                    if (other$isPostage != null) {
                        return false;
                    }
                } else if (!this$isPostage.equals(other$isPostage)) {
                    return false;
                }

                Object this$isHot = this.getIsHot();
                Object other$isHot = other.getIsHot();
                if (this$isHot == null) {
                    if (other$isHot != null) {
                        return false;
                    }
                } else if (!this$isHot.equals(other$isHot)) {
                    return false;
                }

                Object this$num = this.getNum();
                Object other$num = other.getNum();
                if (this$num == null) {
                    if (other$num != null) {
                        return false;
                    }
                } else if (!this$num.equals(other$num)) {
                    return false;
                }

                label286: {
                    Object this$isShow = this.getIsShow();
                    Object other$isShow = other.getIsShow();
                    if (this$isShow == null) {
                        if (other$isShow == null) {
                            break label286;
                        }
                    } else if (this$isShow.equals(other$isShow)) {
                        break label286;
                    }

                    return false;
                }

                label279: {
                    Object this$timeId = this.getTimeId();
                    Object other$timeId = other.getTimeId();
                    if (this$timeId == null) {
                        if (other$timeId == null) {
                            break label279;
                        }
                    } else if (this$timeId.equals(other$timeId)) {
                        break label279;
                    }

                    return false;
                }

                Object this$specType = this.getSpecType();
                Object other$specType = other.getSpecType();
                if (this$specType == null) {
                    if (other$specType != null) {
                        return false;
                    }
                } else if (!this$specType.equals(other$specType)) {
                    return false;
                }

                label265: {
                    Object this$tempId = this.getTempId();
                    Object other$tempId = other.getTempId();
                    if (this$tempId == null) {
                        if (other$tempId == null) {
                            break label265;
                        }
                    } else if (this$tempId.equals(other$tempId)) {
                        break label265;
                    }

                    return false;
                }

                label258: {
                    Object this$image = this.getImage();
                    Object other$image = other.getImage();
                    if (this$image == null) {
                        if (other$image == null) {
                            break label258;
                        }
                    } else if (this$image.equals(other$image)) {
                        break label258;
                    }

                    return false;
                }

                Object this$images = this.getImages();
                Object other$images = other.getImages();
                if (this$images == null) {
                    if (other$images != null) {
                        return false;
                    }
                } else if (!this$images.equals(other$images)) {
                    return false;
                }

                Object this$title = this.getTitle();
                Object other$title = other.getTitle();
                if (this$title == null) {
                    if (other$title != null) {
                        return false;
                    }
                } else if (!this$title.equals(other$title)) {
                    return false;
                }

                label237: {
                    Object this$info = this.getInfo();
                    Object other$info = other.getInfo();
                    if (this$info == null) {
                        if (other$info == null) {
                            break label237;
                        }
                    } else if (this$info.equals(other$info)) {
                        break label237;
                    }

                    return false;
                }

                label230: {
                    Object this$giveIntegral = this.getGiveIntegral();
                    Object other$giveIntegral = other.getGiveIntegral();
                    if (this$giveIntegral == null) {
                        if (other$giveIntegral == null) {
                            break label230;
                        }
                    } else if (this$giveIntegral.equals(other$giveIntegral)) {
                        break label230;
                    }

                    return false;
                }

                Object this$price = this.getPrice();
                Object other$price = other.getPrice();
                if (this$price == null) {
                    if (other$price != null) {
                        return false;
                    }
                } else if (!this$price.equals(other$price)) {
                    return false;
                }

                label216: {
                    Object this$otPrice = this.getOtPrice();
                    Object other$otPrice = other.getOtPrice();
                    if (this$otPrice == null) {
                        if (other$otPrice == null) {
                            break label216;
                        }
                    } else if (this$otPrice.equals(other$otPrice)) {
                        break label216;
                    }

                    return false;
                }

                Object this$cost = this.getCost();
                Object other$cost = other.getCost();
                if (this$cost == null) {
                    if (other$cost != null) {
                        return false;
                    }
                } else if (!this$cost.equals(other$cost)) {
                    return false;
                }

                label202: {
                    Object this$unitName = this.getUnitName();
                    Object other$unitName = other.getUnitName();
                    if (this$unitName == null) {
                        if (other$unitName == null) {
                            break label202;
                        }
                    } else if (this$unitName.equals(other$unitName)) {
                        break label202;
                    }

                    return false;
                }

                Object this$postage = this.getPostage();
                Object other$postage = other.getPostage();
                if (this$postage == null) {
                    if (other$postage != null) {
                        return false;
                    }
                } else if (!this$postage.equals(other$postage)) {
                    return false;
                }

                Object this$description = this.getDescription();
                Object other$description = other.getDescription();
                if (this$description == null) {
                    if (other$description != null) {
                        return false;
                    }
                } else if (!this$description.equals(other$description)) {
                    return false;
                }

                Object this$startTime = this.getStartTime();
                Object other$startTime = other.getStartTime();
                if (this$startTime == null) {
                    if (other$startTime != null) {
                        return false;
                    }
                } else if (!this$startTime.equals(other$startTime)) {
                    return false;
                }

                label174: {
                    Object this$stopTime = this.getStopTime();
                    Object other$stopTime = other.getStopTime();
                    if (this$stopTime == null) {
                        if (other$stopTime == null) {
                            break label174;
                        }
                    } else if (this$stopTime.equals(other$stopTime)) {
                        break label174;
                    }

                    return false;
                }

                label167: {
                    Object this$items = this.getItems();
                    Object other$items = other.getItems();
                    if (this$items == null) {
                        if (other$items == null) {
                            break label167;
                        }
                    } else if (this$items.equals(other$items)) {
                        break label167;
                    }

                    return false;
                }

                Object this$attrs = this.getAttrs();
                Object other$attrs = other.getAttrs();
                if (this$attrs == null) {
                    if (other$attrs != null) {
                        return false;
                    }
                } else if (!this$attrs.equals(other$attrs)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof StoreSeckill;
    }

    public int hashCode() {
        boolean PRIME = true;
        int result = super.hashCode();
        Object $id = this.getId();
        result = result * 59 + ($id == null ? 43 : $id.hashCode());
        Object $productId = this.getProductId();
        result = result * 59 + ($productId == null ? 43 : $productId.hashCode());
        Object $sort = this.getSort();
        result = result * 59 + ($sort == null ? 43 : $sort.hashCode());
        Object $stock = this.getStock();
        result = result * 59 + ($stock == null ? 43 : $stock.hashCode());
        Object $sales = this.getSales();
        result = result * 59 + ($sales == null ? 43 : $sales.hashCode());
        Object $status = this.getStatus();
        result = result * 59 + ($status == null ? 43 : $status.hashCode());
        Object $isPostage = this.getIsPostage();
        result = result * 59 + ($isPostage == null ? 43 : $isPostage.hashCode());
        Object $isHot = this.getIsHot();
        result = result * 59 + ($isHot == null ? 43 : $isHot.hashCode());
        Object $num = this.getNum();
        result = result * 59 + ($num == null ? 43 : $num.hashCode());
        Object $isShow = this.getIsShow();
        result = result * 59 + ($isShow == null ? 43 : $isShow.hashCode());
        Object $timeId = this.getTimeId();
        result = result * 59 + ($timeId == null ? 43 : $timeId.hashCode());
        Object $specType = this.getSpecType();
        result = result * 59 + ($specType == null ? 43 : $specType.hashCode());
        Object $tempId = this.getTempId();
        result = result * 59 + ($tempId == null ? 43 : $tempId.hashCode());
        Object $image = this.getImage();
        result = result * 59 + ($image == null ? 43 : $image.hashCode());
        Object $images = this.getImages();
        result = result * 59 + ($images == null ? 43 : $images.hashCode());
        Object $title = this.getTitle();
        result = result * 59 + ($title == null ? 43 : $title.hashCode());
        Object $info = this.getInfo();
        result = result * 59 + ($info == null ? 43 : $info.hashCode());
        Object $giveIntegral = this.getGiveIntegral();
        result = result * 59 + ($giveIntegral == null ? 43 : $giveIntegral.hashCode());
        Object $price = this.getPrice();
        result = result * 59 + ($price == null ? 43 : $price.hashCode());
        Object $otPrice = this.getOtPrice();
        result = result * 59 + ($otPrice == null ? 43 : $otPrice.hashCode());
        Object $cost = this.getCost();
        result = result * 59 + ($cost == null ? 43 : $cost.hashCode());
        Object $unitName = this.getUnitName();
        result = result * 59 + ($unitName == null ? 43 : $unitName.hashCode());
        Object $postage = this.getPostage();
        result = result * 59 + ($postage == null ? 43 : $postage.hashCode());
        Object $description = this.getDescription();
        result = result * 59 + ($description == null ? 43 : $description.hashCode());
        Object $startTime = this.getStartTime();
        result = result * 59 + ($startTime == null ? 43 : $startTime.hashCode());
        Object $stopTime = this.getStopTime();
        result = result * 59 + ($stopTime == null ? 43 : $stopTime.hashCode());
        Object $items = this.getItems();
        result = result * 59 + ($items == null ? 43 : $items.hashCode());
        Object $attrs = this.getAttrs();
        result = result * 59 + ($attrs == null ? 43 : $attrs.hashCode());
        return result;
    }
}
